<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/15
 * Time: 10:20
 */
include_once 'common.php';
include_once '../tools/DbTools.php';
$is_login = getLoginStatus();
if (!$is_login){
    echo '您尚未登录，<a href="loginUi.php">去登录</a>';
    die;
}else{
    session_start();
    $Token = $_COOKIE['Token'];
    $userInfo  = $_SESSION[$Token];
    $RealName = $userInfo['RealName'];
    $CardNo = $userInfo['CardNo'];
    DbTools::initDb();
    $sql = "select CardMoney from bankcard where CardId = ".$userInfo['CardId'];
    $result = DbTools::select($sql);
    DbTools::close();
    $money = $result[0]['CardMoney'];
}



?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <h1>用户中心</h1>
    <h2>欢迎您，<?php echo $RealName.'<br/>'?><a href="logoutAction.php">退出登录</a>
    <p>您的卡号是：<?php echo $CardNo?><br/>余额：<?php echo $money?></p></h2>
    <h2>
        <ul>
            <li><a href="../money/moneyIn.php">存钱</a></li>
            <li><a href="../money/moneyOut.php">取钱</a></li>
            <li><a href="../money/transfer.php">转账</a></li>
        </ul>
    </h2>
</body>
</html>